package ch.vd.dec.selt.petale

class Prestation {
	
	String name
	String abbr
	TypePrestation type
	Integer priority
	String header
	String footer
	String auto
	String taxe
	
	static mapping = {
		table 'TPRE_FAC'
		name column:'name'
		abbr column:'abbr'
		type column:'ty_pre'
		priority column:'priority'
		header column:'header'
		footer column:'footer'
		auto column:'auto'
		taxe column:'is_taxe_exploit'
		id generator:'sequence', params:[sequence: 'TPRE_FAC_SEQ']
		version true
		groupes sort:'groupe'
	}
	
	static hasMany = [groupes:GroupePrestation]
	
    static constraints = {
		name(blank: false, maxSize: 255, unique: true)
		abbr(blank: false, maxSize: 20, unique: true)
		type(blank: false)
		priority(blank: false, unique: true)
		header(nullable: true, maxSize: 1000)
		footer(nullable: true, maxSize: 1000)
		auto(blank: false, inList:['0','1'])
		taxe(blank: false, inList:['0','1'])
    }
	
	
	
	String toString(){
		return name
	}
	
}
